﻿( function ( exports ) {
	'use strict';

	function parseUrlString( url ) {

		var payload = {},
			query = url.split( '?' )[1],
			vars = query.split( '&' ),
			pair = null;

		for ( var i = 0; i < vars.length; i++ ) {

			pair = vars[i].split( '=' );

			payload[pair[0]] = decodeURIComponent( pair[1] );
		}

		return payload;
	}

	///
	/// Public API
	///
	exports.util = exports.util || {};
	exports.util.getUrlPayload = parseUrlString;

}( window.crk = window.crk || {}) );